package cn.easybuy.entity;

public class BuyCar {
    private String img;         // 图片路径
    private int id;             // 商品id
    private String name;        // 商品名称
    private float price;        // 商品价格
    private int num;            // 商品数量
    private float sum;          // 商品总价

    public BuyCar() {
    }

    public BuyCar(String img, int id, String name, float price, int num) {
        this.img = img;
        this.id = id;
        this.name = name;
        this.price = price;
        this.num = num;
    }

    public float getSum() {
        return sum;
    }

    public void setSum(float price,int num) {
        this.sum = price * num;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public float getPrice() {
        return price;
    }

    public void setPrice(float price) {
        this.price = price;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }
}
